package edu.sctu.practice.class01.renpingan.assign02.Vehicle;

/**
 * Created by Administrator on 2015/10/15.
 */
public class Vehicle {
    int speed;
    int size;

    public Vehicle(int speed, int size) {
        this.speed = speed;
        this.size = size;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public int speedup(int addspeed) {
        System.out.println("加速后的速度为：" + (addspeed + speed));
        return speed = addspeed + speed;
    }

    public int speeddown(int addspeed) {
        System.out.println("减速后的速度为：" + ( speed-addspeed));
        return speed = speed-addspeed;
    }

    public void move() {
        System.out.println("该车已经启动起来了");
    }
    public void showInfo(){
        System.out.println("此时的速度为："+speed);
        System.out.println("车的体积为："+size);


    }
}
